<template>
  <div class="search">
    <el-form ref="form" :model="sizeForm" label-width="80px" size="mini">
      <el-form-item label="创建时间">
        <el-col :span="11">
          <el-date-picker
            
            placeholder="选择日期"
            v-model="sizeForm.date1"
            style="width: 220px"
          ></el-date-picker>
        </el-col>
      </el-form-item>
      <el-form-item label="工作类型">
        <el-select
          v-model="sizeForm.region"
          placeholder="接诊"
          style="width: 100px"
        >
          <el-option label="接诊" value="0"></el-option>
          <el-option label="急诊" value="1"></el-option>
        </el-select>
      </el-form-item>
      <el-input
        v-model="sizeForm.input"
        clearable
        @click="clear"
        @change="searchEnfn"
        placeholder="请输入姓名或手机号"
        id="search-input"
      >
      </el-input>
      <el-button
        type="primary"
        @click="searchfn"
        icon="el-icon-search"
      ></el-button>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      sizeForm: {
        input: "",
        region: "",
        date1: "",
      },
    };
  },
  methods: {
    clear() {
      this.input = "";
    },
    searchfn() {
      this.$emit("searchParent", this.sizeForm.input);
    },
    searchEnfn() {
      this.searchfn();
    },
  },
};
</script>

<style lang="less" scoped>
.search {
  width: 100%;
  padding-top: 30px;
  .el-form {
    display: flex;
  }
  /deep/.el-input {
    width: 211px;
    height: 30px;
  }
  /deep/.el-input--mini {
    width: 100px;
  }
  /deep/.el-button {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    border-radius: 0 4px 4px 0;
    margin-left: 30px;
  }
  /deep/#search-input {
    height: 30px;
    margin-left: 30px;
    border-radius: 4px 0 0 4px;
  }
}
</style>